<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

/**
 * App\Luodiye
 *
 * @property int $id
 * @property string|null $name
 * @property int|null $link_id
 * @property string|null $images
 * @property \Illuminate\Support\Carbon|null $created_at
 * @property \Illuminate\Support\Carbon|null $updated_at
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Luodiye newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Luodiye newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Luodiye query()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Luodiye whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Luodiye whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Luodiye whereImages($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Luodiye whereLinkId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Luodiye whereName($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Luodiye whereUpdatedAt($value)
 * @mixin \Eloquent
 */
class Luodiye extends Model
{
    protected $table='luodiye';
    public function setImagesAttribute($pictures)
    {
        if (is_array($pictures)) {
            $this->attributes['images'] = json_encode($pictures);
        }
    }

    public function getImagesAttribute($pictures)
    {
        return json_decode($pictures, true);
    }
}
